RawBitmap Buoy package.

RawBitmap Class

A class to handle bitmaps on memory block level without dependency to Buoys Graphics functions.

The RawBitmap can handle, RGB, Gray and CMYK color spaces.

The RawBitmap can handle 8bit, 16 bit, and float depths.

The RawBitmap manages color profiles.

Object
   RawBitmap

class RawBitmap

Constructors

RawBitmap (private) Private Constructor for internal.
RawBitmapConstructs a new 4 channel RawBitmap with a given width and given height.
RawBitmapConstructs a new RawBitmap with a given width, given height and given number of channels.
RawBitmapConstructs a new RawBitmap with a given width, given height, given number of channels and given rowBytes value.
RawBitmapConstructs a new RawBitmap with a given width, given height, bitmap format type and given rowBytes value.
RawBitmapConstructs a RawBitmap with a given color space. This constructor can either take external Bytes block instance or internally allocate the memory by it self

Properties

BitmapFormatReturns the format of the color components in the RawBitmap
BytesReturns the Buoy byte block if the RawBitmap was created with Buoy byte block as backing, else nil is returned.
ChannelsReturns the number of channels in the bitmap.
ColorSpaceReturns info on what kind of colorspace the RawBitmap has. (RGB, Gray or CMYK). This can be any value from the RawBitmap.ColorSpaces enum.
DataPtrReturns pointer to Internals of the object.
DepthReturns the depth per channel of the bitmap.
HasAlphaChannelReturns true if the RawBitmap has alpha channel, else false.
HasICCProfileReturns true if the RawBitmap has ICC Color profile, else false
HeightReturns the height of the Bitmap in pixels.
HorizontalResolutionReturns the horizontal resolution of the image. (This can be set if the image was for example read from Jpg)
ICCProfileDataReturns set value of the name of the ICC Color profile.
ICCProfileNameReturns the raw ICC Color profile data if the RawBitmap contains ICC profile.
IsFloatPixelMapReturns true if the pixel map is based on floats.
PixelBytesReturns number of bytes per pixel in the image.
PremultipliedReturns true if the bitmap is known to be premultiplied.
RowBytesReturns the number of bytes in each row of the bitmap.
VerticalResolutionReturns the vertical resolution of the image. (This can be set if the image was for example read from Jpg)
WidthReturns the width of the Bitmap in pixels.

Methods

ClearICCProfileRemoves ICC color profile from the RawBitmap
CloneClones the RawBitmap and optionally adds alpha channel.
ConvertConverts between RawBitmap formats.
CopyICCColorProfileFromCopies ICC profile from other RawBitmap instance and puts it on this instance of the RawBitmap
CropCrops the image, returning a new RawBitmap with the result or nil if no parts of the image were within the Crop parameters.
DrawBitmapDraws a RawBitmap into the RawBitmap
DrawEllipseDraws non filled ellipse.
DrawLineDraws a line at given location into the RawBitmap with a given color.
DrawLineAntialiasedDraws antialiased line at given location into the RawBitmap with a given color.
DrawPixelDraws pixel on the RawBitmap, doing alpha blending as needed depending on the color passed in,
DrawRectDraws non filled rectangle.
FillRectDraws filled rectangle of given color
FillRectAlphaDraws only the alpha channel of filled rectangle
shared FromRawBitmapPtrCreates RawBitmap from internal RawBitmapPtr
shared GetModuleHandshakeGets module handshake instance which is used for package cross talk.
PixelGets the color of a pixel in the RawBitmap.
PixelSets the color of a pixel in the RawBitmap.
PixelAlphaGets the alpha value for pixel at given location
PixelAlphaSets the alpha value for pixel at given location
UnpremultiplyUnpremultiplies the RawBitmap if it is premultiplied.

Enumerations

BitmapFormatsEnum that represents the format of the color components. The constants are named as follows:
  • g - Stands for grayscale channel.
  • A - Stands for alpha channel.
  • R - Stands for red channel.
  • G - Stands for green channel.
  • B - Stands for blue channel.
  • X - Stands for unused channel.
  • C - Stands for cyan channel.
  • M - Stands for magenta channel.
  • Y - Stands for yellow channel.
  • K - Stands for key channel. (used in CMYK color spaces)
  • ColorSpacesA enum that has definitions of color spaces.

    Supported Platforms:

  • macOS Intel 64 bit
  • macOS Apple Silicon
  • Windows 64 bit
  • Windows ARM 64 bit
  • Linux 64 bit
  • Linux ARM 64 bit